import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "normalize.css";
import "./styles/index.scss"
/**
 * 引入elementui
 */
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';


// Vue.use(ElementUI);
import components from './utils/components';

Vue.mixin({
        data() {
            return {
                /**
                 * 数据列表
                 */
                list: [],
                /**
                 * 查loading
                 */
                queryloading: false,
            }
        },

    })
    /**
     * 时间格式化
     */
Date.prototype.format = function(fmt = 'yyyy-MM-dd HH:mm:ss') { 
    /**
     * 日期数据
     */
     
    const opts = { 'y+': this.getFullYear().toString(), 'M+': (this.getMonth() + 1).toString(), 'd+': this.getDate().toString(), 'H+': this.getHours().toString(), 'm+': this.getMinutes().toString(), 's+': this.getSeconds().toString(), 'f+': this.getMilliseconds().toString()  } 
    for (const key in opts) {
        const value = opts[key];  //时间值

        if (new RegExp(`(${key})`).test(fmt)) {
            const result = RegExp.$1; //如果匹配成功则可以获取到结果

            fmt = fmt.replace(result, value.padStart(result.length, '0'));
        } 
    } 
    return fmt;
}

Vue.use(components);

Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')